/**
 * 权限登陆认证
 *
 */
import { request } from "@/lib/request";

/**
 * 登陆
 * 发送短信验证码
 */
export const ApiUserLoginSendVerificationCode = (data) => {
  return request({
    url: "/post/login/sendVerificationCode",
    method: "POST",
    data,
  });
};

/**
 * 登陆
 * 短信验证码登录
 */
export const ApiUserLoginUserLoginVerficationCode = (data) => {
  return request({
    url: "/post/login/userLoginVerficationCode",
    method: "POST",
    data,
  });
};

/**
 * 登陆
 * 退出登录
 */
export const ApiUserLoginLogOut = (data) => {
  return request({
    url: "/post/logOut",
    method: "POST",
    data,
  });
};

/*
 * 获取用户信息
 * @param {}
 * @return
 */
export const ApiGetUserInfo = (data) => {
  return request({
    url: "/post/getUserInfo",
    method: "POST",
    data,
  });
};

/**
 * 小程序授权手机号注册登录
 */
export const ApiWxUserPhoneRegister = (data) => {
  return request({
    url: "/post/wx/phoneRegister",
    method: "POST",
    data,
  });
};

/**
 * 小程序登录
 */
export const ApiWxUserLogin = (data) => {
  return request({
    url: "/post/wx/login",
    method: "POST",
    data,
  });
};

/**
 * 获取签名信息
 * @param {}
 * @return
 */
export const ApiGetSign = (params = {}) => {
  return request({
    url: "/get/wx/jsapi/getSign",
    method: "GET",
    params,
  });
};

/**
 * 微信公众号授权登录
 * @param {}
 * @return
 */
export const ApiWxLogin = (params = {}) => {
  return request({
    url: "/post/wx/redirect/login",
    method: "GET",
    params,
  });
};

/**
 * 公众号登录注册发送验证码
 * @param {}
 * @return
 */
export const ApiWxSendWxOfficialAccountsLoginVerificationCode = (data = {}) => {
  return request({
    url: "/post/wx/redirect/sendWxOfficialAccountsLoginVerificationCode",
    method: "POST",
    data,
  });
};

/**
 * 公众号登录注册
 * @param {}
 * @return
 */
export const ApiWxOfficialAccountsLoginFormSmsVerficationCode = (data = {}) => {
  return request({
    url: "/post/wx/redirect/wxOfficialAccountsLoginFormSmsVerficationCode",
    method: "POST",
    data,
  });
};

/**
 * 图形验证码
 * @param {}
 * @return
 */
export const ApiImageVerificationImageCode = (params = {}) => {
  return request({
    url: "/imageVerification/imageCode",
    method: "GET",
    params,
  });
};

/**
 * 更新用户信息
 * @param {}
 * @return
 */
export const ApiUserUpdateUserInfo = (data) => {
  return request({
    url: "/post/updateUserInfo",
    method: "POST",
    data,
  });
};

/**
 * 获取微信用户信息
 * @param {}
 * @return
 */
export const ApiWxUserInfo = (data) => {
  return request({
    url: "/post/wxUserInfo",
    method: "POST",
    data,
  });
};
